<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="m" uri="/cutm_tags"%>

<head>
<title>记者发稿统计</title>
<script type="text/javascript">
$(document).ready(function(){
	document.getElementById("auditType").value="<s:property value='qm.auditZt'/>";
	if('<s:property value="qm.begDate"/>'==null || '<s:property value="qm.begDate"/>'=="") {
		$("input[name='qm.begDate']").val("");
	}
	if('<s:property value="qm.ubeginDate"/>'==null || '<s:property value="qm.ubeginDate"/>'=="") {
		$("input[name='qm.ubeginDate']").val("");
	}
	if('<s:property value="qm.uendDate"/>'==null || '<s:property value="qm.uendDate"/>'=="") {
		$("input[name='qm.uendDate']").val("");
	}
});
</script>
</head>
<body>
<h2 class="title">记者发稿统计条件：</h2>
<s:form id="statisticsForm" action="statistics/Statistics!statistics">
	<table class="form">
		<s:hidden name="type" value="fgtj" />
		<tr>
			<th width="10%">撰稿开始时间:</th>
			<td width="20%"><m:date name="qm.begDate" cssClass="rule[date]" /></td>
			<th width="10%">撰稿截止时间:</th>
			<td width="20%"><m:date name="qm.endDate" cssClass="rule[date]" /></td>
			<th width="10%">记者:</th>
			<td width="30%"><m:dropUser name="qm.userId" headKey="--请选择--" headValue="" /></td>
		</tr>
		<tr>
			<th width="10%">报道单位:</th>
			<td><m:select enumType="newsFrom.type" name="qm.unit" headKey="---" headValue="" initval="" /></td>
			<th width="10%">播出栏目:</th>
			<td><m:select enumType="program.type" name="qm.programType" headKey="---" headValue="" initval="" /></td>
			<th>地域:</th>
			<td><m:select enumType="region.type" name="qm.regionType" headKey="---" headValue="" initval="" /></td>
		</tr>
		<tr>
			<th width="10%">关键字:</th>
			<td><s:textfield name="qm.title" /></td>
			<th width="10%">稿件类别:</th>
			<td><m:select enumType="manuscript.type" name="qm.manuscriptType" headKey="---" headValue="" initval="" /></td>
			<th>题材类别:</th>
			<td><m:select enumType="submatter.typet" name="qm.submatterTypet" headKey="---" headValue="" initval="" /></td>
		</tr>
		<tr>
			
			<th width="10%">稿件状态:</th>
			<td><select class="" name="qm.auditZt" id="auditType">
				<option title="" value="-1">全部状态</option>
				<option title="" value="0">草稿</option>
				<option title="" value="1">一审中</option>
				<option title="" value="2">二审中</option>
				<option title="" value="3">三审中</option>
				<option title="" value="4">审核完毕</option>
				<option title="" value="-100">毙稿</option>
			</select></td>
			<th>录用次数(>=):</th>
			<td><s:textfield name="qm.times" value="0" /></td>
			<th>查询方式:</th>
			<td><s:radio list='#{ false:"模糊", true:"精确"}' name="qm.exact" /></td>
		</tr>
		<tr>
			<th>录用开始时间:</th>
			<td><m:date name="qm.ubeginDate" cssClass="rule[date]" /></td>
			<th>录用截止时间:</th>
			<td><m:date name="qm.uendDate" cssClass="rule[date]" /></td>
			<td></td>
			<td></td>
		</tr>
	</table>
	<div class="btnGroup"><input type="submit" value="查询" /></div>
</s:form>

<h2 class="title">记者发稿统计汇总</h2>
<table class="list">
	<thead>
		<tr>
			<th width="5%">序号</th>
			<th width="7%">记者</th>
			<th width="13%">所有记者</th>
			<th width="17%">标题</th>
			<th width="7%">栏目</th>
			<th width="10%">报道单位</th>
			<th width="7%">稿件状态</th>
			<th width="10%">撰稿日期</th>
			<th width="7%">使用日期</th>
			<th width="5%">录用次数</th>
			<th width="5%">分数</th>
			<th width="7%">稿件条数</th>
		</tr>
	</thead>
	<tbody>
		<s:set name="gradeTotal" value="0" />
		<s:set name="timesTotal" value="0" />
		<s:iterator value="gjrs" status="aa">
			<tr id="pt${id }">
				<td><s:property value="#aa.index+1" /></td>
				<td><s:property value="manuscript.user.name" /></td>
				<td><s:property value="userName" /></td>
				<td><s:property value="manuscript.title" /></td>
				<td><m:property value="manuscript.column" /></td>
				<td><m:property value="manuscript.unit" /></td>
				<td><s:if test="manuscript.auditZt==0">草稿</s:if> <s:elseif test="manuscript.auditZt==1">一审中</s:elseif> <s:elseif
					test="manuscript.auditZt==2">二审中</s:elseif> <s:elseif test="manuscript.auditZt==3">三审中</s:elseif> <s:elseif
					test="manuscript.auditZt==4">审核完毕</s:elseif> <s:elseif test="manuscript.auditZt==-100">毙稿</s:elseif> <s:else>错误</s:else>
				</td>
				<td><s:date name="manuscript.createDate" format="yyyy-MM-dd HH:mm" /></td>
				<td><s:date name="manuscript.usedDate" format="yyyy-MM-dd" /></td>
				<td><a title="详细信息"  href="../programming/SearchProgram!getProgrammingsByMans.action?manusId=${manuscript.id}"
					target="_blank"><s:property value="manuscript.times" /></a></td>
				<td><s:if test="qm.userId==null">0</s:if><s:else>
					<s:property value="gJian2Reporter.score" />
				</s:else></td>
				<td><s:if test="qm.userId==null">0</s:if><s:else>
					<s:property value="gJian2Reporter.fgCount" />
				</s:else></td>
				<s:set name="gradeTotal" value="#gradeTotal+gJian2Reporter.score" />
				<s:set name="timesTotal" value="#timesTotal+gJian2Reporter.fgCount" />
			</tr>
		</s:iterator>
		<s:if test="qm.userId!=null">
			<tr>
				<td colspan="9" style="text-align: right;">合计:</td>
				<td><s:property value="@com.monlyu.util.MathUtil@formatFraction(#gradeTotal,1)" /></td>
				<td><s:property value="@com.monlyu.util.MathUtil@formatFraction(#timesTotal,1)" /></td>
			</tr>
		</s:if>
	</tbody>
</table>
</body>